/*
 * dwr_misc.h
 *
 *  Created on: 21/05/2013
 *      Author: jose
 */

#ifndef DWR_MISC_H_
#define DWR_MISC_H_


struct dwr_string_st
{
	char * text;
	unsigned len;
};
typedef struct dwr_string_st DwrString;

DwrString *
dwr_string_create_no_len(const char * str);

DwrString *
dwr_string_create_with_len(const char * str, const unsigned len);

DwrString *
dwr_string_itoa(const int value, const char * format, const unsigned len);

unsigned char *
dwr_char_itoa(const int value, const char * format, const unsigned len);

DwrString *
dwr_string_concat(DwrString * s1, const DwrString * s2);

DwrString *
dwr_string_concat_comma(DwrString * s1, short unsigned * previous,
		const char * s2);

DwrString *
dwr_string_concat_comma_quote(DwrString * s1, short unsigned * previous,
		const char * s2);

unsigned char *
dwr_string_get_text(DwrString * str);

char *
dwr_print_unsigned_grouped(unsigned n);


#endif /* DWR_MISC_H_ */
